home *** CD-ROM | disk | FTP | other *** search
/ Whiteline: Alpha / Whiteline Alpha.iso / tex / lindner / texware.zoo / source / web_fun.h < prev   
Encoding:
C/C++ Source or Header  |  1990-07-24  |  754 b   |  35 lines

  1. void append_extension(char * string, char * extension, boolean override)
  2. {
  3. char *point;
  4. char *delimiter;
  5.  
  6.      point     = strrchr(string, '.');
  7.      delimiter = strrchr(string, '\\');
  8.  
  9.      if (point == NULL ||
  10.         (point != NULL && point < delimiter)) {
  11.         strcat(string, ".");
  12.         strcat(string, extension);
  13.         }
  14.      else {
  15.         if (*(point+1) == '\0' || override) {
  16.            *point = '\0';
  17.            strcat(string, ".");
  18.            strcat(string, extension);
  19.            }
  20.         }
  21. }
  22.  
  23.  
  24.  
  25. /*---------------------------*/
  26. /*       cround              */
  27. /*---------------------------*/
  28. LONG     cround(double x)
  29.  
  30. {
  31.      if (x < 0.0)
  32.         return((LONG)(x-0.5));
  33.      return((LONG)(x+0.5));
  34. }
  35.